package package1;

import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.UIManager;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JFormattedTextField;

@SuppressWarnings("serial")
public class DrugiFrame extends JFrame implements ActionListener {

	private JPanel contentPane;
	private JTextField textField;
	JButton btnDan1;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					DrugiFrame frame = new DrugiFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public DrugiFrame() {
		setBackground(UIManager.getColor("Button.disabledForeground"));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		 btnDan1= new JButton("Dan 1");
		btnDan1.setBounds(10, 11, 89, 23);
		btnDan1.addActionListener(this);
		contentPane.add(btnDan1);
		
		JButton btnDan2 = new JButton("Dan 2");
		btnDan2.setBounds(109, 11, 89, 23);
		contentPane.add(btnDan2);
		btnDan2.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		
		JButton btnDan3 = new JButton("Dan 3");
		btnDan3.setBounds(208, 11, 89, 23);
		contentPane.add(btnDan3);
		
		JLabel lblNewLabel = new JLabel("New label");
		lblNewLabel.setBounds(10, 45, 275, 47);
		contentPane.add(lblNewLabel);
		
		textField = new JTextField();
		textField.setBounds(10, 107, 299, 73);
		contentPane.add(textField);
		textField.setColumns(10);
		
		JFormattedTextField frmtdtxtfldFortext = new JFormattedTextField();
		frmtdtxtfldFortext.setText("fortext");
		frmtdtxtfldFortext.setBounds(21, 209, 157, 31);
		contentPane.add(frmtdtxtfldFortext);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if(e.getSource()==btnDan1){
			PrviFrame prvi= new PrviFrame();
			prvi.setVisible(true);
		}
	}
}
